import { callService } from "./api";
import type { UserProfile } from "../types/entities";

export function register(account: string, password: string, role: "chef" | "diner", nickname: string) {
  return callService<{ user: UserProfile }>("authRegister", { account, password, role, nickname });
}

export function login(account: string, password: string) {
  return callService<{ user: UserProfile }>("authLogin", { account, password });
}

export function logout() {
  return callService("authLogout");
}
